<template>
    <view class="offline" :style="{height:height}">
        <image class="offline-img" src="@/static/images/offline.png">

        </image>
        <view class="offline-text">
            <slot>
                <view>当前网络离线</view>
                <view>可以执行保养任务离线作业</view>
            </slot>

        </view>
        <view class="offline-btn" v-if="btn" @click="clickBtnFuc">
            前往任务列表
        </view>

        <!-- <view class="offline-btn" v-if="btn" @click="clickBtnFuc(1)">
            前往任务列表(新
        </view> -->
    </view>
</template>
<script>
export default {
	props:{
		btn:{
			type:Boolean,
			default:true
		},
		height:{
			type:String,
			default:'50vh'
		}
	},
	data() {
		return {

		};
	},
	methods: {
		clickBtnFuc(type) {
			this.$emit('next',type == 1 ? type : '');
		}
	}
};

</script>
<style lang="scss" scoped>
.offline {
    width: 100%; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    &-img {
        width: 72rpx;
        height: 72rpx;
        margin-bottom: 10rpx;
    }

    &-text {
        font-size: 26rpx;
        text-align: center;
        color: #999;
    }

    &-btn {
        color: #fff;
        width: 196rpx;
        height: 60rpx;
        background: #0091ff;
        border-radius: 4rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 26rpx;
        text-align: center;
        line-height: 60rpx;
        margin-top: 20rpx;
    }

}
</style>